1. Field of the Invention
This invention is related to the field of microprocessors and, more particularly, to expanding register files within microprocessors.
2. Description of the Related Art
Modern microprocessors are demanding decreasing memory latency to support the increased performance achievable by the microprocessors. Increasing clock frequencies (i.e. shortening clock cycles) employed by the microprocessors allow for more data and instructions to be processed per second, thereby requiring decreased latency to support maximum performance. Furthermore, modern microprocessor microarchitectures are improving the efficiency at which the microprocessor can process data and instructions. Decreased latency requirements are even further advanced due to the improved processing efficiency.
Computer systems typically have a relatively large, relatively slow main memory. Typically, multiple dynamic random access memory (DRAM) modules comprise the main memory system. The large main memory provides storage for a large number of instructions and/or a large amount of data for use by the microprocessor, providing faster access to the instructions and/or data then may be achieved from a disk storage, for example. However, the access times of modern DRAMs are significantly longer than the clock cycle length of modern microprocessors. The memory access time for each set of bytes being transferred to the microprocessor is therefore long. Accordingly, the main memory system is not a low latency system. Microprocessor performance may suffer due to the high memory latency.
One way to achieved decreased memory latency is to provide registers within the microprocessor. As used herein, a register is a storage location provided within the microprocessor which may be identified by an instruction as storing an operand. In other words, a register is "programmer visible": the programmer may code an instruction which has the register as an operand identifier (or operand address). The value stored in the register may be used as an operand ("direct addressing"), or may be used to form a memory address identifying a memory location at which the operand is stored ("indirect addressing"). The term "operand" refers to a value operated upon or generated by an instruction. A source operand is a value operated upon by an instruction (i.e. is an input to the operation defined by the instruction). A destination operand is a value generated by the instruction (i.e. is an output of the operation defined by the instruction). Either source or destination operands may be stored in registers according to various instruction encodings.
Since registers are included within the microprocessor and the register address is coded directly into an instruction, registers can be accessed rapidly. For example, in modern microprocessors registers can typically still be accessed in one clock cycle, while even caches are beginning to require multiple clock cycles to access. Operands may be stored in registers to reduce the latency for access to those operands. Values stored in memory locations may be loaded into registers for manipulation by instructions. After manipulation by a number of instructions, resulting values may be stored to memory locations. Advantageously, often-used operands may be stored in registers and therefore require fewer memory accesses during the manipulation of the often-used operands. Latency in accessing these operands is thereby decreased, even though memory latency is unchanged.
Because registers can be coded into instructions as operand specifiers, the number and size of registers is generally determined by the microprocessor architecture implemented by a particular microprocessor. The microprocessor architecture defines the instruction set executed by the microprocessor, as well as programmer visible resources such as registers. Furthermore, operation of the microprocessor during context switches is often specified. A context is the set of values (in registers and other microprocessor state, for example) which forms the environment in which a program executes. Just prior to the execution of a particular instruction within a program, the context reflects the results of executing each prior instruction within the program. If a context switch is initiated at the particular instruction so that, for example, another program or routine may be executed, then the context is saved to a predetermined memory location so that the next instruction may be executed upon a return to the context and the same result will be generated as if the context switch had not occurred. The context save may be performed by the microprocessor hardware, may be the responsibility of software, or may be shared between both. As used herein, a context switch is an event in which one context, corresponding to a first program, is replaced within the microprocessor by another context corresponding to a second program.
Since registers are part of the context of the microprocessor, the registers are generally saved during a context switch. Unfortunately, the inclusion of registers in the context makes increasing the number of registers to decrease operand access latency difficult. The context save operation as well as the context storage must be modified, impacting both hardware and software (particularly operating system software). A method for increasing the number of registers without impacting the context is desired.